package com.cloudwise.thread;

/**
 * @author ：Teacher陈
 * @date ：Created in 2021/1/6 14:32
 * @description：继承方式卖火车票
 * @modified By：
 * @version: 1
 */
public class TicketThread  extends Thread {
    //售票员
    private  String name;

    //票数
    private int ticketNum=5;

    public TicketThread(String name) {
        this.name = name;
    }

    @Override
    public void run() {
        for (int i = 1; i <=5 ; i++) {
            System.out.println(name+"卖票"+ticketNum--);
        }
    }


    public static void main(String[] args) {
        new TicketThread("小昭").start();
        new TicketThread("小敏").start();
    }
}
